package springbootreactor;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import reactor.bus.EventBus;
import reactor.event.Event;
import reactor.function.Consumer;

import javax.annotation.Resource;

@Component
public class SayhitConsumerEventHandler implements Consumer<Event<String>> {
    @Resource
    private EventBus eventBus;


    private static Log log=LogFactory.getLog(SayhitConsumerEventHandler.class);
    @Override
    public void accept(Event<String> arg0) {
        // TODO Auto-generated method stub
        log.info("accept:"+arg0.getData());
        arg0.setData(arg0.getData()+" hello world123!");
    }
}